<template>
  <el-dialog
    :title="title"
    :visible.sync="isShow"
    @close="close"
    width="1024px"
    :key="dialogKey"
  >
    <div class="dialog-contant">
      <div class="base-info-desc">
        <!-- <div class="base-title">基本信息</div> -->
        <el-descriptions
          style="margin-bottom: 15px"
          title="基本信息"
          :column="4"
          border
          labelClassName="desc-label"
          contentClassName="desc-content"
        >
          <el-descriptions-item>
            <template slot="label"> 用户名称 </template>
            {{ userInfo.nickName }}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label"> 手机号 </template>
            {{ userInfo.phoneNumber }}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label"> 注册时间 </template>
            {{ userInfo.createTime }}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label"> 发布找车次数 </template>
            {{ findCarNum }}次
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label"> 咨询次数 </template>
            {{ clueNum + consultancyNum }}次
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label"> 发布买车次数 </template>
            {{ bayCarNum }}次
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label"> 发布卖车次数 </template>
            {{ 0 }}次
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label"> 已完结数量 </template>
            {{ consultancyNum }}次
          </el-descriptions-item>
        </el-descriptions>
        <el-tabs v-model="activeTabName" @tab-click="tabClick">
          <el-tab-pane label="正在跟进" name="1">
            <div class="card-contant">
              <el-popover placement="right" width="510" trigger="click">
                <div>
                  <el-table :data="clueList" border size="mini">
                    <el-table-column
                      label="线索编号"
                      align="center"
                      prop="kznum"
                      width="170px"
                    >
                      <template slot-scope="{ row }">
                        <el-button
                          v-if="activeClueId == row.clueId"
                          type="text"
                          >{{ row.kznum }}</el-button
                        >
                        <span
                          style="cursor: pointer"
                          v-else
                          @click="clickClueCol(row)"
                          >{{ row.kznum }}</span
                        >
                      </template>
                    </el-table-column>
                    <el-table-column
                      label="线索状态"
                      align="center"
                      prop="status"
                      width="148px"
                    >
                      <template slot-scope="{ row }">
                        {{ forrmatterEnmu(Enmu.followStatus, row.status) }}
                      </template>
                    </el-table-column>
                    <el-table-column
                      label="线索时间"
                      align="center"
                      prop="createTime"
                      width="160px"
                    >
                      <template slot-scope="scope">
                        <span>{{
                          parseTime(
                            scope.row.createTime,
                            "{y}-{m}-{d} {h}:{i}:{s}"
                          )
                        }}</span>
                      </template>
                    </el-table-column>
                  </el-table>
                  <pagination
                    v-show="clueNum > 0"
                    size="mini"
                    :total="clueNum"
                    :page.sync="clueParams.pageNum"
                    :limit.sync="clueParams.pageSize"
                    @pagination="getClueList"
                  />
                </div>

                <el-button slot="reference" icon="el-icon-s-unfold" size="mini"
                  >查看</el-button
                >
              </el-popover>
            </div>
          </el-tab-pane>
          <el-tab-pane label="找车列表" name="2">
            <div class="card-contant">
              <el-popover placement="right" width="510" trigger="click">
                <el-table :data="findCarList" border size="mini">
                  <el-table-column
                    label="发布人"
                    align="center"
                    prop="kznum"
                    width="170px"
                  >
                    <template slot-scope="{ row }">
                      <el-button v-if="activeFindCarId == row.id" type="text">{{
                        row.userName
                      }}</el-button>
                      <span
                        style="cursor: pointer"
                        @click="clickFindCarCol(row)"
                        v-else
                        >{{ row.userName }}</span
                      >
                    </template>
                  </el-table-column>
                  <el-table-column
                    label="联系电话"
                    align="center"
                    prop=" phone"
                    width="148px"
                  >
                    <template slot-scope="{ row }">
                      {{ row.phoneNumber }}
                    </template>
                  </el-table-column>
                  <el-table-column
                    label="发布时间"
                    align="center"
                    prop="createTime"
                    width="160px"
                  >
                    <template slot-scope="scope">
                      <span>{{ scope.row.createTime }}</span>
                    </template>
                  </el-table-column>
                </el-table>
                <el-button slot="reference" icon="el-icon-s-unfold" size="mini"
                  >查看</el-button
                >
              </el-popover>
            </div>
          </el-tab-pane>
          <el-tab-pane label="买车列表" name="4">
            <div class="card-contant">
              <el-popover placement="right" width="510" trigger="click">
                <el-table :data="bayCarList" border size="mini">
                  <el-table-column
                    label="发布人"
                    align="center"
                    prop="kznum"
                    width="170px"
                  >
                    <template slot-scope="{ row }">
                      <el-button v-if="activeBayCarId == row.id" type="text">{{
                        userInfo.nickName
                      }}</el-button>
                      <span
                        style="cursor: pointer"
                        @click="clickBayCarCol(row)"
                        v-else
                        >{{ userInfo.nickName }}</span
                      >
                    </template>
                  </el-table-column>
                  <el-table-column
                    label="联系电话"
                    align="center"
                    prop="phoneNumber"
                    width="148px"
                  >
                    <template slot-scope="{ row }">
                      {{ row.phone }}
                    </template>
                  </el-table-column>
                  <el-table-column
                    label="发布时间"
                    align="center"
                    prop="createTime"
                    width="160px"
                  >
                    <template slot-scope="scope">
                      <span>{{ scope.row.createTime }}</span>
                    </template>
                  </el-table-column>
                </el-table>
                <el-button slot="reference" icon="el-icon-s-unfold" size="mini"
                  >查看</el-button
                >
              </el-popover>
            </div>
          </el-tab-pane>
          <el-tab-pane label="已完结" name="3">
            <div class="card-contant">
              <el-popover placement="right" width="510" trigger="click">
                <div>
                  <el-table :data="consultancyList" border size="mini">
                    <el-table-column
                      label="线索编号"
                      align="center"
                      prop="kznum"
                      width="170px"
                    >
                      <template slot-scope="{ row }">
                        <el-button
                          v-if="consultancyId == row.clueId"
                          type="text"
                          >{{ row.kznum }}</el-button
                        >
                        <span
                          style="cursor: pointer"
                          v-else
                          @click="clickConsultancyCol(row)"
                          >{{ row.kznum }}</span
                        >
                      </template>
                    </el-table-column>
                    <el-table-column
                      label="线索状态"
                      align="center"
                      prop="status"
                      width="148px"
                    >
                      <template slot-scope="{ row }">
                        {{ forrmatterEnmu(Enmu.followStatus, row.status) }}
                      </template>
                    </el-table-column>
                    <el-table-column
                      label="线索时间"
                      align="center"
                      prop="createTime"
                      width="160px"
                    >
                      <template slot-scope="scope">
                        <span>{{
                          parseTime(
                            scope.row.createTime,
                            "{y}-{m}-{d} {h}:{i}:{s}"
                          )
                        }}</span>
                      </template>
                    </el-table-column>
                  </el-table>
                  <pagination
                    v-show="consultancyNum > 0"
                    size="mini"
                    :total="consultancyNum"
                    :page.sync="consultancyParams.pageNum"
                    :limit.sync="consultancyParams.pageSize"
                    @pagination="getFindCarNumList"
                  />
                </div>

                <el-button slot="reference" icon="el-icon-s-unfold" size="mini"
                  >查看</el-button
                >
              </el-popover>
            </div>
          </el-tab-pane>
        </el-tabs>
        <div class="bottom-contant">
          <!-- 咨询列表 -->
          <div style="flex: 1; display: flex" v-if="activeTabName == 1">
            <div
              class="card-right"
              v-if="baseInfoObject && baseInfoObject.clueId"
            >
              <div class="base-title">线索详情</div>
              <el-descriptions
                style="margin-bottom: 15px"
                title=""
                :column="2"
                border
                labelClassName="desc-label-two"
                contentClassName="desc-content-two"
              >
                <!-- <el-descriptions-item>
                                    <template slot="label">
                                        线索状态
                                    </template>
                                    <el-tag type="success" effect="dark"
                                        v-if="baseInfoObject.clueStatus && baseInfoObject.clueStatus != '5' && baseInfoObject.clueStatus != '6'">
                                        {{ forrmatterEnmu(Enmu.clueStatus, baseInfoObject.clueStatus) }}
                                    </el-tag>
                                </el-descriptions-item> -->
                <el-descriptions-item>
                  <template slot="label"> 意向等级 </template>
                  <span>
                    {{
                      forrmatterEnmu(
                        Enmu.intentionRank,
                        baseInfoObject.intentionRank
                      )
                    }}
                  </span>
                </el-descriptions-item>
                <el-descriptions-item>
                  <template slot="label"> 预警等级 </template>
                  <span v-if="baseInfoObject.warningStatus == 2">
                    <el-tag type="" color="#0000ff" effect="dark" :hit="false">
                      {{
                        forrmatterEnmu(
                          Enmu.warningStatus,
                          baseInfoObject.warningStatus
                        )
                      }}
                    </el-tag>
                  </span>
                  <span v-else-if="baseInfoObject.warningStatus == 4">
                    <el-tag type="" color="#FF7F00" effect="dark">
                      {{
                        forrmatterEnmu(
                          Enmu.warningStatus,
                          baseInfoObject.warningStatus
                        )
                      }}
                    </el-tag>
                  </span>
                  <span v-else-if="baseInfoObject.warningStatus == 3">
                    <el-tag type="" color="#ff0000" effect="dark">
                      {{
                        forrmatterEnmu(
                          Enmu.warningStatus,
                          baseInfoObject.warningStatus
                        )
                      }}
                    </el-tag>
                  </span>
                  <span v-else-if="baseInfoObject.warningStatus == 1">
                    <el-tag type="" color="#F4A708" effect="dark" :hit="true">
                      {{
                        forrmatterEnmu(
                          Enmu.warningStatus,
                          baseInfoObject.warningStatus
                        )
                      }}
                    </el-tag>
                  </span>
                  <span v-else>
                    <el-tag type="" effect="plain">
                      {{
                        forrmatterEnmu(
                          Enmu.warningStatus,
                          baseInfoObject.warningStatus
                        )
                      }}
                    </el-tag>
                  </span>
                </el-descriptions-item>
                <el-descriptions-item>
                  <template slot="label"> 客户类型 </template>
                  {{ baseInfoObject.tags }}
                </el-descriptions-item>
                <el-descriptions-item>
                  <template slot="label"> 托运人电话 </template>
                  {{ baseInfoObject.shipperPhone }}
                </el-descriptions-item>
                <el-descriptions-item>
                  <template slot="label"> 线索来源 </template>
                  {{ forrmatterEnmu(sourceWeb, baseInfoObject.sourceWeb) }}
                </el-descriptions-item>
                <el-descriptions-item :span="2">
                  <template slot="label"> 微信或者QQ </template>
                  {{ baseInfoObject.relationWay }}
                </el-descriptions-item>
                <el-descriptions-item>
                  <template slot="label"> 品牌/车型 </template>
                  {{ baseInfoObject.vehicleTypeOne }}
                </el-descriptions-item>
                <el-descriptions-item>
                  <template slot="label"> 车辆状态 </template>
                  {{ baseInfoObject.vehicleStatus }}
                </el-descriptions-item>
                <el-descriptions-item :span="2">
                  <template slot="label"> 车架/车牌号 </template>
                  {{ baseInfoObject.vin }}
                </el-descriptions-item>
                <el-descriptions-item>
                  <template slot="label"> 始发地 </template>
                  <span v-if="baseInfoObject.province || baseInfoObject.city"
                    >{{ fomatterAdressName(baseInfoObject.province) }} /
                    {{ fomatterAdressName(baseInfoObject.city) }}
                    <span v-if="baseInfoObject.region">
                      / {{ fomatterAdressName(baseInfoObject.region) }}</span
                    >
                  </span>
                </el-descriptions-item>
                <el-descriptions-item>
                  <template slot="label"> 目的地 </template>
                  <span
                    v-if="baseInfoObject.aimProvince || baseInfoObject.aimCity"
                    >{{ fomatterAdressName(baseInfoObject.aimProvince) }} /
                    {{ fomatterAdressName(baseInfoObject.aimCity)
                    }}<span v-if="baseInfoObject.aimRegion">
                      / {{ fomatterAdressName(baseInfoObject.aimRegion) }}</span
                    ></span
                  >
                </el-descriptions-item>
                <el-descriptions-item>
                  <template slot="label"> 底价 </template>
                  <span v-if="baseInfoObject.floorPrice"
                    >{{ baseInfoObject.floorPrice }}元</span
                  >
                </el-descriptions-item>
                <el-descriptions-item>
                  <template slot="label"> 报价 </template>
                  <span v-if="baseInfoObject.price"
                    >{{ baseInfoObject.price }}元</span
                  >
                </el-descriptions-item>
                <el-descriptions-item :span="2">
                  <template slot="label"> 利润 </template>
                  <span v-if="baseInfoObject.price" style="color: red"
                    >{{
                      baseInfoObject.price - baseInfoObject.floorPrice
                    }}元</span
                  >
                </el-descriptions-item>
                <el-descriptions-item>
                  <template slot="label"> 平台订单编号 </template>
                  {{ baseInfoObject.orderNumber }}
                </el-descriptions-item>
                <el-descriptions-item>
                  <template slot="label"> 平台定金 </template>
                  {{ baseInfoObject.earnest }}
                </el-descriptions-item>
                <el-descriptions-item>
                  <template slot="label"> 业务员 </template>
                  {{ baseInfoObject.currentFollowupMan }}
                </el-descriptions-item>
                <el-descriptions-item>
                  <template slot="label"> 下次跟进时间 </template>
                  {{ baseInfoObject.nextTime }}
                </el-descriptions-item>
                <!-- <el-descriptions-item>
                                    <template slot="label">
                                        分配状态
                                    </template>
                                    {{ forrmatterEnmu(Enmu.followStatus, baseInfoObject.status) }}
                                </el-descriptions-item> -->
                <!-- <el-descriptions-item>
                                    <template slot="label">
                                        车辆估值
                                    </template>
                                    <span v-if="baseInfoObject.vehicleEstimationValue">{{
                                        baseInfoObject.vehicleEstimationValue
                                    }}万元</span>
                                </el-descriptions-item> -->

                <!-- <el-descriptions-item>
                                    <template slot="label">
                                        运费
                                    </template>
                                    <span v-if="baseInfoObject.transFee">{{ baseInfoObject.transFee }}元</span>
                                </el-descriptions-item> -->
                <!-- <el-descriptions-item>
                                    <template slot="label">
                                        报价操作人
                                    </template>
                                    {{ baseInfoObject.stepUserName }}
                                </el-descriptions-item> -->

                <!-- <el-descriptions-item :span="2">
                                    <template slot="label">
                                        报价时间
                                    </template>
                                    {{ baseInfoObject.priceCreateTime }}
                                </el-descriptions-item> -->
                <!-- <el-descriptions-item>
                                    <template slot="label">
                                        跟进时间
                                    </template>
                                    {{ baseInfoObject.followupTime }}
                                </el-descriptions-item> -->
                <!-- <el-descriptions-item>
                                    <template slot="label">
                                        发布时间
                                    </template>
                                    {{ baseInfoObject.createTime }}
                                </el-descriptions-item> -->
              </el-descriptions>

              <div class="option-row">
                <!--   -->
                <el-button
                  style="margin-bottom: 15px"
                  type="primary"
                  icon="el-icon-edit"
                  v-if="baseInfoObject.clueStatus !== '3'"
                  @click="openEdit"
                  size="mini"
                  v-hasPermi="['crm:clue:edit']"
                  >编辑</el-button
                >
                <el-button
                  style="margin-bottom: 15px"
                  type="success"
                  icon="el-icon-finished"
                  @click="allocation"
                  size="mini"
                  v-if="baseInfoObject.clueStatus !== '3'"
                  v-hasPermi="['crm:clue:distribution']"
                  >分配</el-button
                >
                <!-- <el-button style="margin-bottom: 15px;" type="" icon="el-icon-circle-close"
                                    v-if="baseInfoObject.clueStatus == '1'" @click="confirmDefeat" size="mini"
                                    v-hasPermi="['crm:clue:defeat']">确认战败</el-button> -->
              </div>
            </div>

            <div class="setp-s" v-if="baseInfoObject && baseInfoObject.clueId">
              <div class="base-title">报价记录</div>
              <div
                class="step-item"
                v-for="(item, index) in baseInfoObject.crmCluePriceStepVoList"
                :key="index"
              >
                <div class="setp-left">
                  <div class="circle"></div>
                  <div
                    class="line"
                    v-if="
                      index != baseInfoObject.crmCluePriceStepVoList.length - 1
                    "
                  ></div>
                </div>
                <div class="setp-content">
                  <div style="color: #666">
                    {{ item.priceCreateTime }}
                    <span v-if="item.type == 1" style="color: #1777ff"
                      >{{ item.stepUserName }} 分配给
                      {{ item.beAssignedName }}</span
                    >
                    <span v-if="item.type == 2" style="color: #1777ff"
                      >系统 分配给 {{ item.beAssignedName }}</span
                    >
                    <span v-if="item.type == 3" style="color: #1777ff"
                      >客服 分配给 {{ item.beAssignedName }}</span
                    >
                  </div>
                  <div style="color: #1a1a1a" v-if="item.stepUserName">
                    编辑人：{{ item.stepUserName }}
                  </div>
                  <div
                    style="color: #1a1a1a"
                    v-if="item.intentionRank || item.intentionRank == 0"
                  >
                    意向：{{
                      forrmatterEnmu(Enmu.intentionRank, item.intentionRank)
                    }}
                  </div>
                  <div style="color: #1a1a1a" v-if="item.stepNextTime">
                    下次跟进时间：{{ item.stepNextTime }}
                  </div>
                  <div style="color: #1a1a1a" v-if="item.intentionRank == 5">
                    战败原因：{{
                      forrmatterEnmu(Enmu.defeatReason, item.defeatStatus)
                    }}
                  </div>
                  <div style="color: #1a1a1a" v-if="item.intentionRank == 6">
                    无效原因：{{
                      forrmatterEnmu(Enmu.nvalidReason, item.defeatStatus)
                    }}
                  </div>
                  <div style="color: #1a1a1a" v-if="item.content">
                    反馈：{{ item.content }}
                  </div>
                  <div style="color: #1a1a1a" v-if="item.defeatRemarks">
                    {{
                      `${item.intentionRank == 5 ? "战败" : "无效"}描述：${
                        item.defeatRemarks
                      }
                                        `
                    }}
                  </div>
                  <div style="color: #1777ff" v-if="item.price">
                    报价：{{ item.price }}元
                  </div>
                  <div style="color: #1777ff" v-if="item.floorPrice">
                    底价：{{ item.floorPrice }}元
                  </div>
                </div>
              </div>
            </div>
          </div>
          <!-- 找车列表 -->
          <div style="flex: 1" v-if="activeTabName == 2 && activeFindCarId">
            <div class="base-title">找车详情</div>
            <el-descriptions
              style="margin-bottom: 15px"
              title=""
              :column="3"
              border
              labelClassName="desc-label-sipl"
              contentClassName="desc-content-sipl"
            >
              <el-descriptions-item>
                <template slot="label"> 始发地 </template>
                {{
                  (findCarFrom.placeOfDeparture &&
                    findCarFrom.placeOfDeparture.replace(/\,/g, "/")) ||
                  ""
                }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 目的地 </template>
                {{
                  (findCarFrom.destination &&
                    findCarFrom.destination.replace(/\,/g, "/")) ||
                  ""
                }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 发布时间 </template>
                {{ findCarFrom.createTime }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 状态 </template>
                {{ forrmatterEnmu(Enmu.transportStatus, findCarFrom.status) }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 车辆名称 </template>
                {{ findCarFrom.vehicleName }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 车型 </template>
                {{ forrmatterEnmu(Enmu.vehicleType, findCarFrom.vehicleType) }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 托运数量 </template>
                {{ findCarFrom.quantity }}台
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 车辆状况 </template>
                {{
                  forrmatterEnmu(Enmu.carStatusList, findCarFrom.vehicleStatus)
                }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 托运时间 </template>
                {{ findCarFrom.shippingDate }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 截止时间 </template>
                {{ findCarFrom.demandExpiryDate }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 备注 </template>
                {{ findCarFrom.note }}
              </el-descriptions-item>
            </el-descriptions>
            <div style="display: flex">
              <div>
                <div class="base-title">
                  <span>报价列表</span>
                </div>
                <div class="list-model">
                  <el-table :data="carQuotationList" size="mini">
                    <el-table-column
                      label="报价公司"
                      align="center"
                      width="180"
                      prop="companyName"
                    ></el-table-column>
                    <el-table-column
                      label="报价(元)"
                      align="center"
                      width="80"
                      prop="price"
                    />
                    <el-table-column
                      label="报价时间"
                      align="center"
                      width="150"
                    >
                      <template slot-scope="scope">
                        {{ scope.row.createTime | forrmatterTime }}
                      </template>
                    </el-table-column>
                    <el-table-column
                      label="预计到达时间"
                      align="center"
                      width="100"
                      prop="estimatedArrivalTime"
                    ></el-table-column>
                  </el-table>
                  <pagination
                    small
                    layout="prev, pager, next"
                    defaultClass="pagination-container-center"
                    v-show="quotationPageInfo.total > 0"
                    :total="quotationPageInfo.total"
                    :page.sync="quotationPageInfo.pageNum"
                    :limit.sync="quotationPageInfo.pageSize"
                    @pagination="carFindQuoteList"
                  />
                </div>
              </div>
              <div style="margin-left: 20px">
                <div class="base-title">
                  <span>联系列表</span>
                </div>
                <div class="list-model">
                  <!-- 联系信息 -->
                  <el-table :data="carLinkList" size="mini">
                    <el-table-column
                      label="联系公司"
                      align="center"
                      width="180"
                      prop="callerName"
                    ></el-table-column>
                    <el-table-column
                      label="拨打时间"
                      align="center"
                      width="140"
                      prop="callTime"
                    ></el-table-column>
                    <el-table-column
                      label="联系次数(次)"
                      align="center"
                      width="100"
                      prop="callCount"
                    ></el-table-column>
                  </el-table>
                  <pagination
                    small
                    layout="prev, pager, next"
                    defaultClass="pagination-container-center"
                    v-show="linkPageInfo.total > 0"
                    :total="linkPageInfo.total"
                    :page.sync="linkPageInfo.pageNum"
                    :limit.sync="linkPageInfo.pageSize"
                    @pagination="carFindCallLogList"
                  />
                </div>
              </div>
            </div>
          </div>
          <!-- 买车列表 -->
          <div style="flex: 1" v-if="activeTabName == 4 && activeBayCarId">
            <div class="base-title">买车详情</div>
            <el-descriptions
              style="margin-bottom: 15px"
              title=""
              :column="3"
              border
              labelClassName="desc-label-sipl"
              contentClassName="desc-content-sipl"
            >
              <el-descriptions-item>
                <template slot="label"> 车辆名称 </template>
                {{ bayCarFrom.brand || "" }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 颜色 </template>
                {{ bayCarFrom.colour }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 价格 </template>
                {{ bayCarFrom.guidePrice }}万
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 联系方式 </template>
                {{ bayCarFrom.phone }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 任务状态 </template>
                {{ bayCarFrom.statusName }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 寻车有效期 </template>
                {{ bayCarFrom.lockForTime }}
              </el-descriptions-item>
              <!-- <el-descriptions-item>
                                <template slot="label">
                                    发布时间
                                </template>
                                {{ bayCarFrom.createTime }}
                            </el-descriptions-item> -->
            </el-descriptions>
            <div>
              <div class="base-title">
                <span>联系列表</span>
              </div>
              <div class="list-model">
                <!-- 联系信息 -->
                <el-table :data="bayCarLinkList" size="mini">
                  <el-table-column
                    label="拨打人"
                    align="center"
                    prop="callerName"
                  ></el-table-column>
                  <el-table-column
                    label="电话"
                    align="center"
                    prop="phoneNumber"
                  ></el-table-column>
                  <el-table-column
                    label="拨打次数"
                    align="center"
                    prop="callCount"
                  ></el-table-column>
                  <el-table-column
                    label="时间"
                    align="center"
                    prop="createTime"
                  ></el-table-column>
                </el-table>
                <pagination
                  small
                  layout="prev, pager, next"
                  defaultClass="pagination-container-center"
                  v-show="bayLinkPageInfo.total > 0"
                  :total="bayLinkPageInfo.total"
                  :page.sync="bayLinkPageInfo.pageNum"
                  :limit.sync="bayLinkPageInfo.pageSize"
                  @pagination="carBayCallLogList"
                />
              </div>
            </div>
          </div>
          <!-- 已完结列表 -->
          <div style="flex: 1; display: flex" v-if="activeTabName == 3">
            <div
              class="card-right"
              v-if="baseInfoObject && baseInfoObject.clueId"
            >
              <div class="base-title">线索详情</div>
              <el-descriptions
                style="margin-bottom: 15px"
                title=""
                :column="2"
                border
                labelClassName="desc-label-two"
                contentClassName="desc-content-two"
              >
                <el-descriptions-item>
                  <template slot="label"> 意向等级 </template>
                  <el-tag
                    type="info"
                    effect="dark"
                    v-if="
                      (baseInfoObject.intentionRank &&
                        baseInfoObject.intentionRank == 5) ||
                      baseInfoObject.intentionRank == 6 ||
                      baseInfoObject.intentionRank == 8 ||
                      baseInfoObject.intentionRank == 9
                    "
                  >
                    {{
                      forrmatterEnmu(
                        Enmu.intentionRank,
                        baseInfoObject.intentionRank
                      )
                    }}
                  </el-tag>
                  <el-tag
                    type="success"
                    effect="dark"
                    v-else-if="
                      baseInfoObject.intentionRank &&
                      baseInfoObject.intentionRank == 7
                    "
                  >
                    {{
                      forrmatterEnmu(
                        Enmu.intentionRank,
                        baseInfoObject.intentionRank
                      )
                    }}
                  </el-tag>
                  <span v-else>
                    {{
                      forrmatterEnmu(
                        Enmu.intentionRank,
                        baseInfoObject.intentionRank
                      )
                    }}
                  </span>
                  <!-- {{ baseInfoObject.clueStatus == '5' ? '' : baseInfoObject.clueStatus == '6' ?
                                        '' : forrmatterEnmu(Enmu.intentionRank, baseInfoObject.clueStatus) }} -->
                </el-descriptions-item>
                <el-descriptions-item>
                  <template slot="label"> 预警等级 </template>
                  <span v-if="baseInfoObject.warningStatus == 2">
                    <el-tag type="" color="#0000ff" effect="dark" :hit="false">
                      {{
                        forrmatterEnmu(
                          Enmu.warningStatus,
                          baseInfoObject.warningStatus
                        )
                      }}
                    </el-tag>
                  </span>
                  <span v-else-if="baseInfoObject.warningStatus == 4">
                    <el-tag type="" color="#FF7F00" effect="dark">
                      {{
                        forrmatterEnmu(
                          Enmu.warningStatus,
                          baseInfoObject.warningStatus
                        )
                      }}
                    </el-tag>
                  </span>
                  <span v-else-if="baseInfoObject.warningStatus == 3">
                    <el-tag type="" color="#ff0000" effect="dark">
                      {{
                        forrmatterEnmu(
                          Enmu.warningStatus,
                          baseInfoObject.warningStatus
                        )
                      }}
                    </el-tag>
                  </span>
                  <span v-else-if="baseInfoObject.warningStatus == 1">
                    <el-tag type="" color="#F4A708" effect="dark" :hit="true">
                      {{
                        forrmatterEnmu(
                          Enmu.warningStatus,
                          baseInfoObject.warningStatus
                        )
                      }}
                    </el-tag>
                  </span>
                  <span v-else>
                    <el-tag type="" effect="plain">
                      {{
                        forrmatterEnmu(
                          Enmu.warningStatus,
                          baseInfoObject.warningStatus
                        )
                      }}
                    </el-tag>
                  </span>
                </el-descriptions-item>
                <el-descriptions-item>
                  <template slot="label"> 客户类型 </template>
                  {{ baseInfoObject.tags }}
                </el-descriptions-item>
                <el-descriptions-item>
                  <template slot="label"> 托运人电话 </template>
                  {{ baseInfoObject.shipperPhone }}
                </el-descriptions-item>
                <el-descriptions-item>
                  <template slot="label"> 线索来源 </template>
                  {{ forrmatterEnmu(sourceWeb, baseInfoObject.sourceWeb) }}
                </el-descriptions-item>
                <el-descriptions-item :span="2">
                  <template slot="label"> 微信或者QQ </template>
                  {{ baseInfoObject.relationWay }}
                </el-descriptions-item>
                <el-descriptions-item>
                  <template slot="label"> 品牌/车型 </template>
                  {{ baseInfoObject.vehicleTypeOne }}
                </el-descriptions-item>
                <el-descriptions-item>
                  <template slot="label"> 车辆状态 </template>
                  {{ baseInfoObject.vehicleStatus }}
                </el-descriptions-item>
                <el-descriptions-item :span="2">
                  <template slot="label"> 车架/车牌号 </template>
                  {{ baseInfoObject.vin }}
                </el-descriptions-item>
                <el-descriptions-item>
                  <template slot="label"> 始发地 </template>
                  <span v-if="baseInfoObject.province || baseInfoObject.city"
                    >{{ fomatterAdressName(baseInfoObject.province) }} /
                    {{ fomatterAdressName(baseInfoObject.city) }}
                    <span v-if="baseInfoObject.region">
                      / {{ fomatterAdressName(baseInfoObject.region) }}</span
                    >
                  </span>
                </el-descriptions-item>
                <el-descriptions-item>
                  <template slot="label"> 目的地 </template>
                  <span
                    v-if="baseInfoObject.aimProvince || baseInfoObject.aimCity"
                    >{{ fomatterAdressName(baseInfoObject.aimProvince) }} /
                    {{ fomatterAdressName(baseInfoObject.aimCity)
                    }}<span v-if="baseInfoObject.aimRegion">
                      / {{ fomatterAdressName(baseInfoObject.aimRegion) }}</span
                    ></span
                  >
                </el-descriptions-item>
                <el-descriptions-item>
                  <template slot="label"> 底价 </template>
                  <span v-if="baseInfoObject.floorPrice"
                    >{{ baseInfoObject.floorPrice }}元</span
                  >
                </el-descriptions-item>
                <el-descriptions-item>
                  <template slot="label"> 报价 </template>
                  {{ baseInfoObject.price }}元
                </el-descriptions-item>
                <el-descriptions-item :span="2">
                  <template slot="label"> 利润 </template>
                  {{ baseInfoObject.proft }}元
                </el-descriptions-item>
                <el-descriptions-item>
                  <template slot="label"> 平台订单编号 </template>
                  {{ baseInfoObject.orderNumber }}
                </el-descriptions-item>
                <el-descriptions-item>
                  <template slot="label"> 平台定金 </template>
                  {{ baseInfoObject.earnest }}
                </el-descriptions-item>
                <el-descriptions-item>
                  <template slot="label"> 业务员 </template>
                  {{ baseInfoObject.currentFollowupMan }}
                </el-descriptions-item>
                <el-descriptions-item>
                  <template slot="label"> 下次跟进时间 </template>
                  {{ baseInfoObject.nextTime }}
                </el-descriptions-item>
                <!-- <el-descriptions-item>
                                    <template slot="label">
                                        线索状态
                                    </template>
                                    <el-tag type="success" effect="dark"
                                        v-if="baseInfoObject.clueStatus && baseInfoObject.clueStatus != '1' && baseInfoObject.clueStatus != '2' && baseInfoObject.clueStatus != '4' && baseInfoObject.clueStatus != '7'">
                                        {{ forrmatterEnmu(Enmu.clueStatus, baseInfoObject.clueStatus) }}
                                    </el-tag>
                                    <el-tag type="info" effect="dark" v-else>
                                        {{ forrmatterEnmu(Enmu.clueStatus, baseInfoObject.clueStatus) }}
                                    </el-tag>
                                </el-descriptions-item> -->
                <!-- <el-descriptions-item>
                                    <template slot="label">
                                        成交状态
                                    </template>
                                    {{ forrmatterEnmu(Enmu.followStatus, baseInfoObject.status) }}
                                </el-descriptions-item> -->
                <!-- <el-descriptions-item>
                                    <template slot="label">
                                        车辆估值
                                    </template>
                                    <span v-if="baseInfoObject.vehicleEstimationValue">{{
                                        baseInfoObject.vehicleEstimationValue
                                    }}万元</span>
                                </el-descriptions-item> -->

                <!-- <el-descriptions-item>
                                    <template slot="label">
                                        运费
                                    </template>
                                    {{ baseInfoObject.transFee }}元
                                </el-descriptions-item> -->
                <!-- <el-descriptions-item>
                                    <template slot="label">
                                        报价操作人
                                    </template>
                                    {{ baseInfoObject.stepUserName }}
                                </el-descriptions-item> -->

                <!-- <el-descriptions-item :span="2">
                                    <template slot="label">
                                        报价时间
                                    </template>
                                    {{ baseInfoObject.priceCreateTime }}
                                </el-descriptions-item> -->
                <!-- <el-descriptions-item>
                                    <template slot="label">
                                        跟进时间
                                    </template>
                                    {{ baseInfoObject.followupTime }}
                                </el-descriptions-item> -->
                <!-- <el-descriptions-item>
                                    <template slot="label">
                                        发布时间
                                    </template>
                                    {{ baseInfoObject.createTime }}
                                </el-descriptions-item> -->
              </el-descriptions>
              <div class="option-row">
                <el-button
                  style="margin-bottom: 15px"
                  type=""
                  icon="el-icon-circle-close"
                  @click="worthlessHandler"
                  size="mini"
                  v-if="baseInfoObject.clueStatus == '2'"
                  v-hasPermi="['crm:clue:worthless']"
                  >确认无效</el-button
                >
                <el-button
                  style="margin-bottom: 15px"
                  type=""
                  icon="el-icon-circle-close"
                  v-if="baseInfoObject.clueStatus == '1'"
                  @click="confirmDefeat"
                  size="mini"
                  v-hasPermi="['crm:clue:defeat']"
                  >确认战败</el-button
                >
              </div>
            </div>

            <div
              class="setp-s"
              style="margin-left: 20px"
              v-if="baseInfoObject && baseInfoObject.clueId"
            >
              <div class="base-title">报价记录</div>
              <div
                class="step-item"
                v-for="(item, index) in baseInfoObject.crmCluePriceStepVoList"
                :key="index"
              >
                <div class="setp-left">
                  <div class="circle"></div>
                  <div
                    class="line"
                    v-if="
                      index != baseInfoObject.crmCluePriceStepVoList.length - 1
                    "
                  ></div>
                </div>
                <div class="setp-content">
                  <div style="color: #666">
                    {{ item.priceCreateTime }}
                    <span v-if="item.type == 1" style="color: #1777ff"
                      >{{ item.stepUserName }}
                      分配给
                      {{ item.beAssignedName }}</span
                    >
                    <span v-if="item.type == 2" style="color: #1777ff"
                      >系统 分配给 {{ item.beAssignedName }}</span
                    >
                    <span v-if="item.type == 3" style="color: #1777ff"
                      >客服 分配给 {{ item.beAssignedName }}</span
                    >
                  </div>
                  <div style="color: #1a1a1a" v-if="item.stepNextTime">
                    下次跟进时间：{{ item.stepNextTime }}
                  </div>
                  <div
                    style="color: #1a1a1a"
                    v-if="item.intentionRank || item.intentionRank == 0"
                  >
                    意向：{{
                      forrmatterEnmu(Enmu.intentionRank, item.intentionRank)
                    }}
                  </div>
                  <div style="color: #1a1a1a" v-if="item.intentionRank == 5">
                    战败原因：{{
                      forrmatterEnmu(Enmu.defeatReason, item.defeatStatus)
                    }}
                  </div>
                  <div style="color: #1a1a1a" v-if="item.intentionRank == 6">
                    无效原因：{{
                      forrmatterEnmu(Enmu.nvalidReason, item.defeatStatus)
                    }}
                  </div>
                  <div style="color: #1a1a1a" v-if="item.content">
                    反馈：{{ item.content }}
                  </div>
                  <div style="color: #1a1a1a" v-if="item.defeatRemarks">
                    {{
                      `${item.intentionRank == 5 ? "战败" : "无效"}描述：${
                        item.defeatRemarks
                      }
                                        `
                    }}
                  </div>
                  <div style="color: #1777ff" v-if="item.price">
                    报价：{{ item.price }}元
                  </div>
                  <div style="color: #1777ff" v-if="item.floorPrice">
                    底价：{{ item.floorPrice }}元
                  </div>
                </div>
              </div>
              <!-- <div class="setp-body">
                            </div> -->
            </div>
          </div>
        </div>
      </div>
    </div>
    <div slot="footer" class="dialog-footer">
      <el-button @click="close">取 消</el-button>
    </div>
    <!-- 编辑 -->
    <el-dialog
      width="700px"
      title="编辑"
      :visible.sync="innerVisible"
      append-to-body
      label-width="120px"
      :close-on-click-modal="false"
    >
      <div>
        <div class="base-title">线索详情</div>
        <el-form
          :model="editClueObj"
          ref="editClueObj"
          size="mini"
          :inline="true"
          :rules="rules"
          :key="isEditClueObj"
        >
          <el-row>
            <el-col :span="12">
              <el-form-item label="托运人电话" prop="shipperPhone">
                <el-input
                  v-model="editClueObj.shipperPhone"
                  placeholder="托运人电话"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="客户类型" prop="tags">
                <el-select v-model="editClueObj.tags" style="width: 140px">
                  <el-option value="新媒体" label="新媒体"></el-option>
                  <el-option value="新车车商" label="新车车商"></el-option>
                  <el-option value="二手车商" label="二手车商"></el-option>
                  <el-option value="4s店" label="4s店"></el-option>
                  <el-option value="同行" label="同行"></el-option>
                  <el-option value="其他" label="其他"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="微信/QQ" prop="relationWay">
                <el-input
                  v-model.trim="editClueObj.relationWay"
                  clearable
                  placeholder="请输入微信/QQ"
                ></el-input>
              </el-form-item>
            </el-col>
            <!-- <el-col :span="12">
                            <el-form-item label="姓名" prop="kzNickname" label-width="60px">
                                <el-input v-model.trim="editClueObj.kzNickname" clearable></el-input>
                            </el-form-item>
                        </el-col> -->
            <el-col :span="12">
              <el-form-item label="车辆状态" prop="vehicleStatus">
                <el-select
                  v-model="editClueObj.vehicleStatus"
                  clearable
                  style="width: 140px"
                >
                  <el-option
                    v-for="(item, index) in carStatus"
                    :value="item"
                    :label="item"
                    :key="index"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="品牌/车型">
                <!-- <el-select v-model="addForm.vehicleTypeOne" style="width: 220px" clearable>
              <el-option v-for="(item, index) in Enmu.vehicleType" :value="item.name" :label="item.name"></el-option>
            </el-select> -->
                <el-input
                  v-model.trim="editClueObj.vehicleTypeOne"
                  clearable
                  placeholder="请输入品牌/车型"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="线索来源" prop="sourceWeb">
                <el-select
                  v-model="editClueObj.sourceWeb"
                  style="width: 130px"
                  clearable
                >
                  <el-option
                    v-for="(item, index) in sourceWeb"
                    :value="item.value"
                    :label="item.name"
                    :key="index"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="车架/车牌号" prop="vin">
                <el-input
                  v-model="editClueObj.vin"
                  placeholder="多个车架/车牌号以逗号隔开"
                  style="width: 140px"
                ></el-input>
              </el-form-item>
            </el-col>
            <!-- <el-col :span="12">
                            <el-form-item label="车辆估值" prop="vehicleEstimationValue">
                                <el-input style="width: 120px;" v-model="editClueObj.vehicleEstimationValue"></el-input>
                                万元
                            </el-form-item>
                        </el-col> -->
            <el-col :span="12">
              <el-form-item
                label="战败原因"
                v-if="editClueObj.status == '4'"
                prop="defeatStatus"
              >
                <el-select v-model="editClueObj.defeatStatus">
                  <el-option
                    v-for="(item, index) in Enmu.defeatReason"
                    :value="item.value"
                    :label="item.name"
                    :key="index"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label=" " v-if="editClueObj.status == '4'">
                <el-input
                  type="textarea"
                  :rows="2"
                  style="width: 400px"
                  v-model="editClueObj.defeatRemarks"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="始发地" prop="province">
                <provice-select
                  :defaultCity="defaultCity"
                  isShowDistrict
                  @changeValue="queryStartChangeValue"
                ></provice-select>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="目的地" prop="aimProvince">
                <provice-select
                  :defaultCity="defaultAimCity"
                  isShowDistrict
                  @changeValue="queryEndChangeValue"
                ></provice-select>
              </el-form-item>
            </el-col>
          </el-row>
          <!-- <el-form-item label="运费" style="width: 45%;">
                        <el-input style="width: 120px;" v-model="editClueObj.transFee"></el-input>
                        元
                    </el-form-item>
                    <el-form-item label="利润" style="width: 45%;">
                        <el-input style="width: 120px;" v-model="editClueObj.proft"></el-input>
                        元
                    </el-form-item> -->
          <!-- <el-form-item label="状态" style="width: 45%;">
                            <el-select v-model="editClueObj.status" style="width: 120px;">
                                <el-option value="4" label="战败"></el-option>
                                <el-option value="5" label="无效"></el-option>
                                <el-option value="6" label="已成交"></el-option>
                            </el-select>
                        </el-form-item> -->
          <!-- <el-form-item label="下次跟进时间" prop="nextTime" v-if="isNextTime">
                        <el-date-picker clearable v-model="editClueObj.nextTime" type="date" value-format="yyyy-MM-dd"
                            placeholder="选择日期" :picker-options="pickerOptions">
                        </el-date-picker>
                    </el-form-item> -->
        </el-form>
        <div class="base-title">
          <span>报价记录</span>
        </div>
        <div class="list-model">
          <el-form
            :model="recordObject"
            ref="recordObject"
            size="small"
            :inline="true"
            label-width="100px"
            :rules="recordRules"
          >
            <el-row>
              <el-col :span="24">
                <el-form-item
                  label="底价"
                  style="width: 100%"
                  prop="floorPrice"
                >
                  <el-input
                    style="width: 200px"
                    v-model="recordObject.floorPrice"
                  ></el-input>
                  元
                </el-form-item>
              </el-col>
              <el-col :span="24">
                <el-form-item label="报价" style="width: 100%" prop="price">
                  <el-input
                    style="width: 200px"
                    v-model="recordObject.price"
                  ></el-input>
                  元<span style="color: red"
                    >（利润：{{
                      recordObject.price - recordObject.floorPrice || 0
                    }}）</span
                  >
                </el-form-item>
              </el-col>
              <el-col :span="24">
                <el-form-item label="内容" style="width: 100%">
                  <el-input
                    type="textarea"
                    :rows="2"
                    style="width: 400px"
                    v-model="recordObject.content"
                  ></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="24">
                <el-form-item
                  label="意向等级"
                  style="width: 100%"
                  prop="intentionRank"
                >
                  <el-select
                    v-model="recordObject.intentionRank"
                    clearable
                    @change="intentionRankChange"
                  >
                    <el-option
                      v-for="(item, index) in Enmu.intentionRank"
                      :value="item.value"
                      :label="item.name"
                      :key="index"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="24">
                <el-form-item
                  label="下次跟进时间"
                  v-if="isNextTime"
                  prop="nextTime"
                >
                  <el-date-picker
                    clearable
                    v-model="recordObject.nextTime"
                    type="date"
                    value-format="yyyy-MM-dd"
                    placeholder="选择日期"
                    :picker-options="pickerOptions"
                  >
                  </el-date-picker>
                </el-form-item>
              </el-col>
              <el-col :span="24">
                <el-form-item
                  label="平台订单编号"
                  prop="orderNumber"
                  v-if="isTransaction"
                >
                  <el-input
                    style="width: 200px"
                    v-model="recordObject.orderNumber"
                    clearable
                    @input="change"
                  ></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="24">
                <el-form-item
                  label="平台定金"
                  prop="earnest"
                  v-if="isTransaction"
                >
                  <el-input
                    style="width: 200px"
                    v-model="recordObject.earnest"
                    clearable
                  ></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="24">
                <el-form-item
                  label="战败原因"
                  v-if="recordObject.intentionRank == '5'"
                  prop="defeatStatus"
                >
                  <el-select v-model="recordObject.defeatStatus">
                    <el-option
                      v-for="(item, index) in Enmu.defeatReason"
                      :value="item.value"
                      :label="item.name"
                      :key="index"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="24">
                <el-form-item
                  label="无效原因"
                  v-if="recordObject.intentionRank == '6'"
                  prop="defeatStatus"
                >
                  <el-select v-model="recordObject.defeatStatus">
                    <el-option
                      v-for="(item, index) in Enmu.nvalidReason"
                      :value="item.value"
                      :label="item.name"
                      :key="index"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="24">
                <el-form-item
                  :label="
                    recordObject.intentionRank == 5 ? '战败描述' : '无效描述'
                  "
                  v-if="
                    recordObject.intentionRank == '5' ||
                    recordObject.intentionRank == '6'
                  "
                >
                  <el-input
                    type="textarea"
                    :rows="2"
                    style="width: 400px"
                    v-model="recordObject.defeatRemarks"
                  ></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <!-- <el-form-item v-if="recordObject.intentionRank != '5' && recordObject.intentionRank != '6' " label="下次跟进时间" style="width: 100%;">
                                <el-date-picker 
                                    clearable 
                                    v-model="recordObject.nextTime" 
                                    type="date" 
                                    value-format="yyyy-MM-dd" 
                                    placeholder="选择日期"
                                    :picker-options="pickerOptions">
                                </el-date-picker>
                            </el-form-item> -->
          </el-form>
        </div>
      </div>
      <div slot="footer" class="dialog-footer">
        <!-- <el-button type="primary" @click="sumitEitRow">提交</el-button> -->
        <el-button type="primary" @click="submitForm">提交</el-button>
        <el-button @click="editClose">取 消</el-button>
      </div>
    </el-dialog>
    <!-- 选择业务员员 -->
    <el-dialog
      width="600px"
      title="选择业务员员"
      :visible.sync="selectMarketDialog"
      append-to-body
    >
      <div>
        <el-form :inline="true" label-width="100px">
          <el-form-item label="销售员列表">
            <el-select v-model="selectMarketIds" style="width: 220px">
              <el-option
                v-for="(item, index) in marketList"
                :key="index"
                :value="item"
                :label="item"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-form>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitAllocation">确定</el-button>
        <el-button @click="selectMarketDialog = false">取 消</el-button>
      </div>
    </el-dialog>
    <!-- 确认战败 -->
    <el-dialog
      width="600px"
      title="确认战败"
      :visible.sync="showDialogDefeat"
      append-to-body
    >
      <div>
        <el-form :model="defeatComfirmObj" label-width="100px">
          <el-form-item label="战败确认">
            <el-select v-model="defeatComfirmObj.status" style="width: 220px">
              <el-option value="7" label="战败确认"></el-option>
              <el-option value="1" label="战败再分配"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="销售员列表" v-if="defeatComfirmObj.status == 1">
            <el-select
              v-model="defeatComfirmObj.selectMarketIds"
              style="width: 220px"
            >
              <el-option
                v-for="(item, index) in marketList"
                :key="index"
                :value="item"
                :label="item"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-form>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitDefeat">确定</el-button>
        <el-button @click="showDialogDefeat = false">取 消</el-button>
      </div>
    </el-dialog>
    <!-- 无效确认 -->
    <el-dialog
      width="600px"
      title="确认无效"
      :visible.sync="isInvalid"
      append-to-body
    >
      <div>
        <el-form :model="InvalidConfirmation" label-width="100px">
          <el-form-item label="无效确认">
            <el-select
              v-model="InvalidConfirmation.status"
              style="width: 220px"
            >
              <el-option value="7" label="无效确认"></el-option>
              <el-option value="1" label="无效再分配"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item
            label="销售员列表"
            v-if="InvalidConfirmation.status == 1"
          >
            <el-select
              v-model="InvalidConfirmation.selectMarketIds"
              style="width: 220px"
            >
              <el-option
                v-for="(item, index) in marketList"
                :key="index"
                :value="item"
                :label="item"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-form>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitInvalid">确定</el-button>
        <el-button @click="isInvalid = false">取 消</el-button>
      </div>
    </el-dialog>
  </el-dialog>
</template>
<script>
import {
  getClueIdToUserInfo,
  getFindCarInfo,
  getMarketList,
  getClueInfo,
  getConsultancyInfo,
  getClueLibraryDetail,
  submitClueOffer,
  carFindQuotes,
  carFindCallLogs,
  submitUpdateClue,
  manualDistribution,
  clueAffirmDefeat,
  getUserIdToInfo,
  notarizeInvalid,
  getUserBuySellCar,
  listbuySellCarId,
} from "@/api/crm/clueLibrary";
import Enmu from "@/utils/enmu.js";
import { listData } from "@/api/system/dict/data.js";
import { forrmatterEnmu, timestampToDate } from "@/utils/index";
import ProviceSelect from "@/components/ProviceSelect/index.vue";
import { mapGetters } from "vuex";
export default {
  components: { ProviceSelect },
  data() {
    return {
      Enmu,
      title: "详情",
      pickerOptions: {
        disabledDate(time) {
          let now = timestampToDate("", "ymd");
          let times = timestampToDate(new Date(time).getTime(), "ymd");
          return new Date(times).getTime() <= new Date(now).getTime();
        },
      },
      isShow: false,
      activeTabName: "1",
      baseInfoObject: {},
      userInfo: {},
      // 找车字段
      findCarList: [],
      findCarNum: 0,
      findCarParams: {
        pageNum: 1,
        pageSize: 10,
      },
      findCarFrom: {},
      activeFindCarId: "",
      // 买车字段
      bayCarList: [],
      bayCarNum: 0,
      bayCarParams: {
        pageNum: 1,
        pageSize: 10,
      },
      bayCarFrom: {},
      activeBayCarId: "",
      consultancyList: [],
      consultancyNum: 0,
      consultancyParams: {
        pageNum: 1,
        pageSize: 10,
      },
      editRow: false,
      consultancyId: "",
      recordObject: {
        content: null,
        price: null,
        intentionRank: null,
        defeatStatus: null,
        defeatRemarks: null,
        nextTime: null,
        floorPrice: null,
      },
      defaultCity: {
        province: "",
        city: "",
        district: "",
      },
      defaultAimCity: {
        province: "",
        city: "",
        district: "",
      },
      carQuotationList: [],
      carLinkList: [],
      bayCarLinkList: [],
      quotationPageInfo: {
        pageNum: 1,
        pageSize: 10,
        total: 0,
      },
      linkPageInfo: {
        pageNum: 1,
        pageSize: 10,
        total: 0,
      },
      bayLinkPageInfo: {
        pageNum: 1,
        pageSize: 10,
        total: 0,
      },
      clueList: [],
      clueNum: 0,
      clueParams: {
        pageNum: 1,
        pageSize: 10,
      },
      activeClueId: "",
      innerVisible: false,
      editClueObj: {},
      marketList: [],
      selectMarketIds: "",
      selectMarketDialog: false,
      showDialogDefeat: false,
      defeatComfirmObj: {
        status: "",
        selectMarketIds: "",
      },
      rules: {},
      recordRules: {
        intentionRank: [
          { required: true, message: "内容不能为空", trigger: "change" },
        ],
      },
      isEditClueObj: true,
      sourceWeb: [],
      // carStatus: [
      //     '正常车辆', '油车/燃油亏损', '油车/电量亏损', '电车/电量亏损', '事故车', '证件缺失', '纠纷车'
      // ],
      carStatus: [
        "新车",
        "二手车",
        "燃油车",
        "新能源",
        // "正常车辆",
        "故障车",
        "抵押车",
        "亏油",
        "亏电",
        // "油电亏损车辆",
        "非常规车辆（三轮车、摩托车、改装车、商用车、超尺寸车辆）",
      ],
      isTransaction: false,
      isNextTime: false,
      isInvalid: false,
      InvalidConfirmation: {
        status: "",
        selectMarketIds: "",
      },
      dialogKey: false,
    };
  },
  filters: {
    forrmatterTime(time) {
      if (!time || time == "") return "";
      return timestampToDate(time, "ymdhm");
    },
  },
  props: {
    showDialog: {
      default: false,
      type: Boolean,
    },
    baseInfo: {
      default() {
        return {};
      },
      type: Object,
    },
    // 1 线索   2 用户  3成交  4发布
    pageType: {
      default: "1",
      type: String,
    },
  },
  watch: {
    showDialog(n) {
      this.isShow = n;
      if (n) {
        this.baseInfoObject = {};
        this.activeClueId = null;
        this.consultancyId = null;
        this.bayCarFrom = null;
        this.bayCarLinkList = null;
        this.clueList = null;
        this.consultancyList = null;
        if (this.pageType == "1" || this.pageType == "3") {
          this.getUserInfo();
        } else if (this.pageType == "2") {
          this.userIdToInfo();
        }
        if (this.pageType == "3") {
          this.activeTabName = "3";
        } else {
          this.activeTabName = "1";
        }
        this.listMarket();
      }
    },
  },
  computed: {
    ...mapGetters(["allCityList"]),
  },
  created() {
    this.isShow = this.showDialog;
    this.getSourceList();
  },
  updated() {
    // if (this.baseInfo.clueStatus == '3') {
    //     this.isEdit = false
    // } else {
    //     this.isEdit = true
    // }
    // this.recordObject = {
    //     content: null,
    //     price: null,
    //     intentionRank: null,
    //     defeatStatus: null,
    //     defeatRemarks: null,
    //     nextTime: null,
    //     floorPrice: null
    // }
  },
  methods: {
    change(v) {
      this.recordObject.orderNumber = v;
      this.$set(this.recordObject, "orderNumber", v);
      console.log("111", v);
    },
    forrmatterEnmu,
    close() {
      this.$emit("close", false);
    },
    confirmDefeat() {
      this.showDialogDefeat = true;
      this.defeatComfirmObj = {
        status: "",
        selectMarketIds: "",
      };
    },
    worthlessHandler() {
      this.isInvalid = true;
      this.InvalidConfirmation = {
        status: "",
        selectMarketIds: "",
      };
    },
    // 查询字典数据
    getSourceList() {
      listData({
        pageNum: 1,
        pageSize: 10,
        dictType: "client_source",
      }).then((res) => {
        if (res.code == 200) {
          this.sourceWeb = res.rows.map((item) => {
            return {
              value: item.dictValue,
              name: item.dictLabel,
            };
          });
        }
      });
    },
    // 确认战败
    submitDefeat() {
      if (this.defeatComfirmObj.status == "1") {
        manualDistribution({
          clueIdList: [this.consultancyId],
          currentFollowupMan: this.defeatComfirmObj.selectMarketIds,
        }).then((res) => {
          if (res.code == 200) {
            this.$modal.msgSuccess("分配成功");
            this.showDialogDefeat = false;
            this.defeatComfirmObj = {
              status: "",
              selectMarketIds: "",
            };
            this.getClueDetail(this.consultancyId);
          }
        });
      } else if (this.defeatComfirmObj.status == "7") {
        clueAffirmDefeat({ clueId: this.consultancyId }).then((res) => {
          if (res.code == 200) {
            this.$modal.msgSuccess("成功");
            this.showDialogDefeat = false;
            this.defeatComfirmObj = {
              status: "",
              selectMarketIds: "",
            };
            this.getClueDetail(this.consultancyId);
          }
        });
      }
    },
    // 确认无效
    submitInvalid() {
      if (this.InvalidConfirmation.status == "1") {
        manualDistribution({
          clueIdList: [this.consultancyId],
          currentFollowupMan: this.InvalidConfirmation.selectMarketIds,
        }).then((res) => {
          if (res.code == 200) {
            this.$modal.msgSuccess("分配成功");
            this.isInvalid = false;
            this.InvalidConfirmation = {
              status: "",
              selectMarketIds: "",
            };
            this.getClueDetail(this.consultancyId);
          }
        });
      } else if (this.InvalidConfirmation.status == "7") {
        notarizeInvalid({ clueId: this.consultancyId }).then((res) => {
          if (res.code == 200) {
            this.$modal.msgSuccess("成功");
            this.isInvalid = false;
            this.InvalidConfirmation = {
              status: "",
              selectMarketIds: "",
            };
            this.getClueDetail(this.consultancyId);
          }
        });
      }
    },
    openEdit() {
      this.innerVisible = true;
      this.editClueObj = JSON.parse(JSON.stringify(this.baseInfoObject));
      console.log(this.editClueObj, "this.editClueObj");

      this.defaultCity = {
        province: this.editClueObj.province,
        city: this.editClueObj.city,
        district: this.editClueObj.region,
      };
      this.defaultAimCity = {
        province: this.editClueObj.aimProvince,
        city: this.editClueObj.aimCity,
        district: this.editClueObj.aimRegion,
      };
      this.recordObject = {
        content: null,
        defeatRemarks: null,
        defeatStatus: null,
        floorPrice: null,
        intentionRank: null,
        nextTime: null,
        price: null,
        orderNumber: null,
        earnest: null,
      };
      for (const key in this.recordObject) {
        this.recordObject[key] = this.baseInfoObject[key];
      }
      this.intentionRankChange(this.baseInfoObject.intentionRank);
      // Object.assign(this.recordObject, this.baseInfoObject)
      this.editClueObj.status = "";
      this.editClueObj.defeatStatus = "";
      this.editClueObj.defeatRemarks = "";
    },
    // 获取业务员员列表
    listMarket() {
      getMarketList().then((res) => {
        this.marketList = res.data;
      });
    },
    // 省市区转换成中文
    fomatterAdressName(code) {
      let index = this.allCityList?.findIndex((ele) => ele.id == code);
      return index > -1 ? this.allCityList[index].cityName : code;
    },
    // 根据线索id查用户信息
    getUserInfo() {
      getClueIdToUserInfo({ clueId: this.baseInfo.clueId }).then((res) => {
        this.userInfo = res.data || {};
        this.getCarInfo();
        this.getBayCarInfo();
        console.log("888", this.userInfo);
        if (this.userInfo.phoneNumber) {
          // this.$modal.alertError("该用户没有手机号");
          this.getFindCarNumList();
          this.getClueList();
        } else {
          this.getFindCarNumLists();
          this.getClueLists();
        }
      });
    },
    // 跟进用户id查用户信息
    userIdToInfo() {
      getUserIdToInfo({ userId: this.baseInfo.userId }).then((res) => {
        this.userInfo = res.data || {};
        this.userInfo.phoneNumber = this.userInfo.phonenumber;
        this.getCarInfo();
        this.getBayCarInfo();
        if (!this.userInfo.phoneNumber) {
          this.$modal.alertError("该用户没有手机号");
          return;
        }
        this.getFindCarNumList();
        this.getClueList();
      });
    },
    // 根据用户id查询找车信息
    getCarInfo() {
      getFindCarInfo({
        userId: this.userInfo.userId,
        ...this.findCarParams,
      }).then((res) => {
        this.findCarNum = res.total;
        this.findCarList = res.rows || [];
        if (this.findCarParams.pageNum == 1 && this.findCarList.length > 0) {
          this.activeFindCarId = this.findCarList[0].id;
          this.findCarFrom = this.findCarList[0];
          this.carFindQuoteList();
          this.carFindCallLogList();
        }
      });
    },
    // 点击找车列表的某一行
    clickFindCarCol(row) {
      this.activeFindCarId = row.id;
      this.findCarFrom = { ...row };
      this.$set(this.quotationPageInfo, "pageNum", 1);
      this.$set(this.linkPageInfo, "pageNum", 1);
      this.carFindQuoteList();
      this.carFindCallLogList();
    },
    // 找车报价列表
    carFindQuoteList() {
      let { pageNum, pageSize } = this.quotationPageInfo;
      carFindQuotes({ pageNum, pageSize, demandId: this.activeFindCarId }).then(
        (res) => {
          this.carQuotationList = res.rows;
          this.$set(this.quotationPageInfo, "total", res.total);
        }
      );
    },
    // 找车联系列表
    carFindCallLogList() {
      let { pageNum, pageSize } = this.linkPageInfo;
      carFindCallLogs({
        pageNum,
        pageSize,
        demandId: this.activeFindCarId,
      }).then((res) => {
        this.carLinkList = res.rows;
        this.$set(this.linkPageInfo, "total", res.total);
      });
    },
    // 根据用户id查询买车信息
    getBayCarInfo() {
      getUserBuySellCar({
        userId: this.userInfo.userId,
        ...this.bayCarParams,
      }).then((res) => {
        this.bayCarNum = res.total;
        this.bayCarList = res.rows || [];
        if (this.bayCarParams.pageNum == 1 && this.bayCarList.length > 0) {
          this.activeBayCarId = this.bayCarList[0].id;
          this.bayCarFrom = this.bayCarList[0];
          this.carBayCallLogList();
        }
      });
    },
    // 点击买车列表的某一行
    clickBayCarCol(row) {
      this.activeBayCarId = row.id;
      this.bayCarFrom = { ...row };
      this.$set(this.bayLinkPageInfo, "pageNum", 1);
      this.carBayCallLogList();
    },
    // 买车联系列表
    carBayCallLogList() {
      let { pageNum, pageSize } = this.bayLinkPageInfo;
      listbuySellCarId({
        pageNum,
        pageSize,
        buySellCarId: this.activeBayCarId,
      }).then((res) => {
        this.bayCarLinkList = res.rows;
        this.$set(this.bayLinkPageInfo, "total", res.total);
      });
    },
    // 根据手机号查询成交列表
    getFindCarNumList() {
      getConsultancyInfo({
        phone: this.userInfo.phoneNumber,
        ...this.consultancyParams,
      }).then((res) => {
        this.consultancyNum = res.total;
        this.consultancyList = res.rows || [];
        if (
          this.consultancyParams.pageNum == 1 &&
          this.consultancyList.length > 0
        ) {
          // this.consultancyId = this.consultancyList[0].clueId;
          if (
            this.baseInfo.clueStatus != 5 &&
            this.baseInfo.clueStatus != 6 &&
            this.baseInfo.clueStatus != 8
          ) {
            this.consultancyId = this.baseInfo.clueId;
          } else {
            this.consultancyId = this.consultancyList[0].clueId;
          }
          if (this.activeTabName == "3") {
            this.getClueDetail(this.consultancyId);
          }
        }
      });
    },
    // 根据线索编号查询成交列表
    getFindCarNumLists() {
      getConsultancyInfo({
        kznum: this.baseInfo.kznum,
        ...this.consultancyParams,
      }).then((res) => {
        this.consultancyNum = res.total;
        this.consultancyList = res.rows || [];
        if (
          this.consultancyParams.pageNum == 1 &&
          this.consultancyList.length > 0
        ) {
          // this.consultancyId = this.consultancyList[0].clueId;
          if (
            this.baseInfo.clueStatus != 5 &&
            this.baseInfo.clueStatus != 6 &&
            this.baseInfo.clueStatus != 8
          ) {
            this.consultancyId = this.baseInfo.clueId;
          } else {
            this.consultancyId = this.consultancyList[0].clueId;
          }
          if (this.activeTabName == "3") {
            this.getClueDetail(this.consultancyId);
          }
        }
      });
    },
    // 根据手机号查询咨询列表
    getClueList() {
      console.log("666", this.activeClueId);
      getClueInfo({
        phone: this.userInfo.phoneNumber,
        ...this.clueParams,
      }).then((res) => {
        this.clueNum = res.total;
        this.clueList = res.rows || [];
        if (
          this.clueParams.pageNum == 1 &&
          this.clueList.length > 0 &&
          this.activeTabName == "1" &&
          this.pageType != "2"
        ) {
          if (
            this.baseInfo.clueStatus == 5 ||
            this.baseInfo.clueStatus == 6 ||
            this.baseInfo.clueStatus == 8
          ) {
            this.activeClueId = this.baseInfo.clueId;
          } else {
            this.activeClueId = this.clueList[0].clueId;
          }
          this.getClueDetail(this.activeClueId);
        }
      });
    },
    // 根据线索编号查询咨询列表
    getClueLists() {
      getClueInfo({ kznum: this.baseInfo.kznum, ...this.clueParams }).then(
        (res) => {
          console.log("222", res.rows);
          this.clueNum = res.total;
          this.clueList = res.rows || [];
          if (
            this.clueParams.pageNum == 1 &&
            this.clueList.length > 0 &&
            this.activeTabName == "1" &&
            this.pageType != "2"
          ) {
            // this.activeClueId = this.clueList[0].clueId;
            this.activeClueId = this.baseInfo.clueId;
            this.getClueDetail(this.baseInfo.clueId);
          } else {
            this.activeClueId = this.clueList[0].clueId;
          }
        }
      );
    },
    // 获取线索详情
    getClueDetail(clueId) {
      // getClueLibraryDetail({ clueId: this.baseInfo.clueId }).then(res => {
      getClueLibraryDetail({ clueId }).then((res) => {
        this.baseInfoObject = res.data;
        this.baseInfoObject.content =
          res.data.crmCluePriceStepVoList[0]?.content;
        console.log("this.baseInfoObject", this.baseInfoObject);
      });
    },
    clickClueCol(row) {
      this.activeClueId = row.clueId;
      this.getClueDetail(this.activeClueId);
    },
    clickConsultancyCol(row) {
      this.consultancyId = row.clueId;
      this.getClueDetail(this.consultancyId);
    },
    queryStartChangeValue(values) {
      this.editClueObj.province = values[0];
      this.editClueObj.city = values[1];
      this.editClueObj.region = values[2];
    },
    queryEndChangeValue(values) {
      this.editClueObj.aimProvince = values[0];
      this.editClueObj.aimCity = values[1];
      this.editClueObj.aimRegion = values[2];
    },
    addRecord() {
      this.editRow = true;
      this.baseInfoObject.stepVoList.unshift({
        content: "",
        price: "",
      });
    },
    // 提交记录
    sumitEitRow() {
      let index = -1;
      if (JSON.stringify(this.recordObject) != "{}") {
        Object.keys(this.recordObject).forEach((ele) => {
          if (this.recordObject[ele] && this.recordObject[ele] != "") {
            index = index + 1;
          }
        });
      } else {
        return;
      }
      if (index > -1) {
        submitClueOffer({
          clueId: this.activeClueId,
          ...this.recordObject,
        }).then((res) => {
          if (res.code == 200) {
            this.$modal.msgSuccess("提交成功");
            // this.innerVisible = false;
            // this.editClueObj = {};
            this.getClueDetail(this.activeClueId);
            this.recordObject = {};
          }
        });
      }
    },

    submitForm() {
      let status = this.editClueObj.status;
      if (this.editClueObj.status == "") {
        status = this.baseInfoObject.status;
      }
      let proft = this.recordObject.price - this.recordObject.floorPrice;
      // this.editClueObj.floorPrice = this.recordObject.floorPrice
      let {
        floorPrice,
        price,
        content,
        intentionRank,
        nextTime,
        orderNumber,
        earnest,
        defeatStatus,
        defeatRemarks,
      } = this.recordObject;
      let obj = {
        floorPrice,
        price,
        content,
        intentionRank,
        nextTime,
        orderNumber,
        earnest,
        defeatStatus,
        defeatRemarks,
      };
      this.$refs["recordObject"].validate((v) => {
        if (v) {
          this.$refs["editClueObj"].validate((v) => {
            if (v) {
              submitUpdateClue({
                clueId: this.editClueObj.clueId,
                ...this.editClueObj,
                ...obj,
                status,
                proft,
              }).then((res) => {
                if (res.code == 200) {
                  this.$modal.msgSuccess("提交成功");
                  // this.getClueDetail(this.editClueObj.clueId);
                  this.innerVisible = false;
                  console.log("intentionRank", intentionRank);
                  // Object.assign(this.recordObject, {})
                  this.$nextTick(() => {
                    this.close();
                    // if (intentionRank == 7) {
                    // } else
                    //     if (intentionRank == 5 || intentionRank == 6 || intentionRank == 8) {
                    //         this.activeTabName = "3";
                    //     } else {
                    //         this.activeTabName = "1";
                    //     }
                    // this.dialogKey = !this.dialogKey
                  });
                  this.getUserInfo();
                  console.log("111", this.baseInfoObject);
                }
              });
            }
          });
        }
      });
    },
    editClose() {
      this.innerVisible = false;
      Object.assign(this.recordObject, {});
    },
    // tab切换
    tabClick({ name }, event) {
      console.log(name, 456);
      if (name == 1) {
        if (this.activeClueId && this.activeClueId != "") {
          // this.getClueDetail(this.activeClueId);
          this.getUserInfo();
        } else {
          this.baseInfoObject = {};
        }
      } else if (name == 3) {
        if (this.consultancyId && this.consultancyId != "") {
          // this.getClueDetail(this.consultancyId)
          this.getUserInfo();
        } else {
          this.editClueObj = {};
          this.baseInfoObject = {};
        }
        console.log(this.editClueObj, this.baseInfoObject);
      }
    },
    allocation(row) {
      this.selectMarketDialog = true;
      this.selectMarketIds = "";
    },
    submitAllocation() {
      manualDistribution({
        clueIdList: [this.activeClueId || this.baseInfo.clueId],
        currentFollowupMan: this.selectMarketIds,
      }).then((res) => {
        if (res.code == 200) {
          this.$modal.msgSuccess("分配成功");
          this.selectMarketDialog = false;
          this.selectMarketIds = "";
          this.getClueDetail(this.activeClueId || this.baseInfo.clueId);
        }
      });
    },
    // 意向等级改变
    intentionRankChange(value) {
      console.log(this.Enmu.intentionRank, value, 888);
      let isRules = {
        province: [
          { required: true, message: "内容不能为空", trigger: "change" },
        ],
        aimProvince: [
          { required: true, message: "内容不能为空", trigger: "change" },
        ],
        tags: [{ required: true, message: "内容不能为空", trigger: "change" }],
        vehicleEstimationValue: [
          { required: true, message: "内容不能为空", trigger: "change" },
        ],
        shipperPhone: [
          { required: true, message: "内容不能为空", trigger: "change" },
        ],
        vehicleStatus: [
          { required: true, message: "内容不能为空", trigger: "change" },
        ],
        defeatStatus: [
          { required: true, message: "内容不能为空", trigger: "change" },
        ],
        vin: [{ required: true, message: "内容不能为空", trigger: "change" }],
        sourceWeb: [
          { required: true, message: "内容不能为空", trigger: "change" },
        ],
      };
      let isRecordRules = {
        floorPrice: [
          { required: true, message: "内容不能为空", trigger: "change" },
        ],
        price: [{ required: true, message: "内容不能为空", trigger: "change" }],
      };
      if (value == 0 || value == 1 || value == 2 || value == 3 || value == 4) {
        this.recordRules.nextTime = [
          { required: true, message: "内容不能为空", trigger: "change" },
        ];
        this.recordRules.floorPrice = null;
        this.recordRules.price = null;
        // this.isEditClueObj = !this.isEditClueObj
        // this.recordObject.nextTime = this.editClueObj.nextTime
        this.isNextTime = true;
        this.isTransaction = false;
        this.formRulesChange();
      } else if (value == 5 || value == 6) {
        this.recordRules.defeatStatus = [
          { required: true, message: "内容不能为空", trigger: "change" },
        ];
        this.recordRules.nextTime = null;
        this.recordRules.floorPrice = null;
        this.recordRules.price = null;
        // this.isEditClueObj = !this.isEditClueObj
        this.isNextTime = false;
        this.isTransaction = false;
        this.formRulesChange();
      } else if (value == 7) {
        Object.assign(this.recordRules, isRecordRules);
        this.isTransaction = true;
        this.rules = isRules;
        this.isNextTime = false;
        // this.isEditClueObj = !this.isEditClueObj
      } else {
        this.formRulesChange();
        this.isTransaction = false;
        this.recordRules.nextTime = null;
        this.recordRules.defeatStatus = null;
        // this.isEditClueObj = !this.isEditClueObj
        this.isNextTime = false;
      }
    },
    // 改变表单验证状态
    formRulesChange() {
      this.rules = {
        province: null,
        aimProvince: null,
        tags: null,
        vehicleEstimationValue: null,
        shipperPhone: null,
        vehicleStatus: null,
        defeatStatus: null,
        vin: null,
        sourceWeb: null,
      };
      for (const key in this.rules) {
        this.$nextTick(() => {
          if (key) this.$refs["editClueObj"].clearValidate([`${key}`]);
        });
      }
    },
  },
};
</script>
<style lang="scss">
.base-info-desc {
  width: 100%;

  .desc-label {
    width: 120px;
    color: #1a1a1a;
  }

  .desc-label-sipl {
    width: 80px;
    color: #1a1a1a;
    flex: 0 0 80px;
  }

  .desc-content-sipl {
    width: 22%;
  }

  .desc-content {
    width: 15%;
  }

  .el-form-item__label {
    font-weight: 400;
  }

  .desc-label-two {
    width: 80px;
    color: #1a1a1a;
    flex: 0 0 80px;
  }

  .desc-content-two {
    width: 30%;
  }
}
</style>
<style scoped lang="scss">
.dialog-contant {
  display: flex;
  width: inherit;
}

.base-title {
  font-size: 18rpx;
  color: #1a1a1a;
  display: flex;
  align-items: center;
  margin-bottom: 15px;

  &::before {
    content: "";
    display: inline-block;
    width: 3px;
    height: 15px;
    background: #1777ff;
    border-radius: 3px;
    margin-right: 8px;
  }
}

.base-info {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  margin-bottom: 10px;

  .base-info-item {
    width: 33%;
    margin-bottom: 8px;
  }
}

.card-contant {
  display: flex;

  .card-table {
    width: 480px;
  }
}

.list-model {
  position: relative;

  .el-table {
    margin-bottom: 10px;
  }

  .submit-btn {
    position: absolute;
    right: 0px;
    top: 52px;
  }
}

.bottom-contant {
  display: flex;
  margin-top: 20px;

  .card-right {
    flex: 1;
  }
}

.setp-s {
  width: 400px;
  margin-left: 20px;
  height: 500px;
  overflow-y: scroll;

  .setp-body {
  }

  .step-item {
    display: flex;

    .setp-left {
      height: auto;
      width: 15px;
      display: flex;
      flex-direction: column;
      // justify-content: center;
      align-items: center;
    }

    .circle {
      width: 15px;
      height: 15px;
      background: #1777ff;
      border-radius: 15px;
    }

    .line {
      width: 2px;
      background: #1777ff;
      flex: 1;
    }

    .setp-content {
      font-size: 12px;
      margin-left: 10px;
      padding-bottom: 15px;
    }
  }
}
</style>
